Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use isolatedModules for all ts-jest configs to lower memory footprint on CI #27670

Conversation

Hotell
Copy link
Contributor

@Hotell Hotell commented Apr 24, 2023

Previous Behavior

Using type-checking with ts-jest is a know big performance bottleneck. While we use diagnostic:false it wont turn the actual TS program creation.

New Behavior

  • type checking is now disabled for every project that uses ts-jest, which improves speeds of tests and lowers down memory/CPU consumption == faster CI
  • updated migrate-converged-pkg generator
  • v9 jest configs updated via automation nx workspace-generator migrate-converged-pkg --all

Speed metrics:

command: @fluentui/react test --no-cache --runInBand time delta remarks
ts-jest (current state) 281s BASE
ts-jest + isolatedModules:true 260s 7%

Related Issue(s)

@Hotell Hotell changed the title test: use isolatedModules for all ts-jest configs to lower memory foo… test: use isolatedModules for all ts-jest configs to lower memory footprint on CI Apr 24, 2023
@github-actions github-actions bot added this to the April Project Cycle Q2 2023 milestone Apr 24, 2023
@Hotell Hotell mentioned this pull request Apr 24, 2023
11 tasks
@Hotell Hotell force-pushed the hotell/build/faster-ci/jest-config-memory-improvements branch from e9c563e to 2ecacd5 Compare April 24, 2023 14:24
@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 24, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit bb18624:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Apr 24, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 51767fd6bcd9fedcfe6e4b4735fdf13a1f1174bb (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 24, 2023

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 904 937 5000
Button mount 494 504 5000
Field mount 1686 1768 5000
FluentProvider mount 1150 1180 5000
FluentProviderWithTheme mount 140 137 10
FluentProviderWithTheme virtual-rerender 122 126 10
FluentProviderWithTheme virtual-rerender-with-unmount 141 136 10
InfoButton mount 28 23 5000
MakeStyles mount 1400 1328 50000
Persona mount 2656 2604 5000
SpinButton mount 2054 2101 5000

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 24, 2023

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
TreeWith60ListItems.default 117 105 1.11:1
ButtonMinimalPerf.default 107 98 1.09:1
AvatarMinimalPerf.default 141 130 1.08:1
LoaderMinimalPerf.default 255 241 1.06:1
SkeletonMinimalPerf.default 254 240 1.06:1
ListNestedPerf.default 411 397 1.04:1
ReactionMinimalPerf.default 276 266 1.04:1
ChatWithPopoverPerf.default 255 247 1.03:1
DatepickerMinimalPerf.default 4712 4596 1.03:1
RefMinimalPerf.default 143 139 1.03:1
VideoMinimalPerf.default 521 508 1.03:1
AttachmentMinimalPerf.default 97 95 1.02:1
CardMinimalPerf.default 373 365 1.02:1
CheckboxMinimalPerf.default 1589 1557 1.02:1
HeaderMinimalPerf.default 263 258 1.02:1
InputMinimalPerf.default 733 719 1.02:1
SegmentMinimalPerf.default 246 241 1.02:1
TableManyItemsPerf.default 1437 1403 1.02:1
TextMinimalPerf.default 248 244 1.02:1
TreeMinimalPerf.default 594 584 1.02:1
AttachmentSlotsPerf.default 837 825 1.01:1
ButtonSlotsPerf.default 402 397 1.01:1
ChatMinimalPerf.default 533 528 1.01:1
DialogMinimalPerf.default 579 576 1.01:1
DropdownMinimalPerf.default 1823 1800 1.01:1
EmbedMinimalPerf.default 2391 2372 1.01:1
FormMinimalPerf.default 268 265 1.01:1
HeaderSlotsPerf.default 568 565 1.01:1
ImageMinimalPerf.default 270 267 1.01:1
ItemLayoutMinimalPerf.default 897 892 1.01:1
LayoutMinimalPerf.default 261 258 1.01:1
MenuMinimalPerf.default 627 620 1.01:1
PortalMinimalPerf.default 119 118 1.01:1
ProviderMergeThemesPerf.default 975 963 1.01:1
ProviderMinimalPerf.default 273 270 1.01:1
RadioGroupMinimalPerf.default 333 330 1.01:1
SliderMinimalPerf.default 921 914 1.01:1
SplitButtonMinimalPerf.default 3018 2991 1.01:1
StatusMinimalPerf.default 505 499 1.01:1
IconMinimalPerf.default 447 441 1.01:1
AccordionMinimalPerf.default 104 104 1:1
AnimationMinimalPerf.default 363 362 1:1
ButtonOverridesMissPerf.default 830 831 1:1
CarouselMinimalPerf.default 341 341 1:1
DividerMinimalPerf.default 261 260 1:1
FlexMinimalPerf.default 194 194 1:1
ListCommonPerf.default 490 489 1:1
ListMinimalPerf.default 376 377 1:1
ListWith60ListItems.default 484 484 1:1
MenuButtonMinimalPerf.default 1261 1255 1:1
PopupMinimalPerf.default 450 451 1:1
ToolbarMinimalPerf.default 659 660 1:1
TooltipMinimalPerf.default 1585 1588 1:1
DropdownManyItemsPerf.default 488 495 0.99:1
RosterPerf.default 1788 1806 0.99:1
TextAreaMinimalPerf.default 350 353 0.99:1
CustomToolbarPrototype.default 1874 1897 0.99:1
BoxMinimalPerf.default 240 246 0.98:1
ChatDuplicateMessagesPerf.default 195 200 0.98:1
LabelMinimalPerf.default 275 280 0.98:1
TableMinimalPerf.default 293 300 0.98:1
AlertMinimalPerf.default 188 197 0.95:1
GridMinimalPerf.default 233 247 0.94:1

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 24, 2023

🕵 fluentuiv8 No visual regressions between this PR and main

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 24, 2023

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
533 B
341 B
global-context
createContextSelector
560 B
352 B
priority-overflow
createOverflowManager
3.194 kB
1.314 kB
react-accordion
Accordion (including children components)
88.891 kB
26.6 kB
react-alert
Alert
95.74 kB
23.13 kB
react-avatar
Avatar
59.494 kB
15.587 kB
react-avatar
AvatarGroup
18.223 kB
6.7 kB
react-avatar
AvatarGroupItem
75.719 kB
20.079 kB
react-badge
Badge
26.099 kB
7.632 kB
react-badge
CounterBadge
27.084 kB
7.943 kB
react-badge
PresenceBadge
34.573 kB
8.739 kB
react-button
Button
39.864 kB
9.996 kB
react-button
CompoundButton
47.012 kB
11.471 kB
react-button
MenuButton
44.55 kB
11.357 kB
react-button
SplitButton
52.961 kB
12.932 kB
react-button
ToggleButton
58.243 kB
11.927 kB
react-card
Card - All
86.061 kB
24.345 kB
react-card
Card
80.997 kB
22.895 kB
react-card
CardFooter
9.158 kB
3.844 kB
react-card
CardHeader
11.048 kB
4.538 kB
react-card
CardPreview
9.963 kB
4.192 kB
react-checkbox
Checkbox
37.083 kB
11.285 kB
react-combobox
Combobox (including child components)
89.775 kB
28.537 kB
react-combobox
Dropdown (including child components)
88.459 kB
28.262 kB
react-components
react-components: Button, FluentProvider & webLightTheme
67.986 kB
18.429 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
207.27 kB
57.634 kB
react-components
react-components: FluentProvider & webLightTheme
38.773 kB
12.375 kB
react-datepicker-compat
DatePicker Compat
223.13 kB
58.944 kB
react-dialog
Dialog (including children components)
93.747 kB
27.527 kB
react-divider
Divider
20.072 kB
6.742 kB
react-field
Field
21.537 kB
7.454 kB
react-image
Image
14.067 kB
5.012 kB
react-infobutton
InfoButton
130.761 kB
39.509 kB
react-infobutton
InfoLabel
133.987 kB
40.517 kB
react-input
Input
26.806 kB
8.151 kB
react-label
Label
12.693 kB
4.626 kB
react-link
Link
12.357 kB
5.091 kB
react-menu
Menu (including children components)
131.068 kB
39.705 kB
react-menu
Menu (including selectable components)
134.074 kB
40.243 kB
react-overflow
hooks only
11.214 kB
4.271 kB
react-persona
Persona
66.426 kB
17.533 kB
react-popover
Popover
117.744 kB
35.886 kB
react-portal
Portal
11.649 kB
4.263 kB
react-portal-compat
PortalCompatProvider
6.446 kB
2.186 kB
react-positioning
usePositioning
24.008 kB
8.798 kB
react-progress
ProgressBar
16.445 kB
5.865 kB
react-provider
FluentProvider
20.72 kB
7.14 kB
react-radio
Radio
29.897 kB
9.112 kB
react-radio
RadioGroup
13.984 kB
5.154 kB
react-select
Select
28.03 kB
9.235 kB
react-slider
Slider
36.947 kB
11.506 kB
react-spinbutton
SpinButton
36.718 kB
10.802 kB
react-spinner
Spinner
23.498 kB
7.244 kB
react-switch
Switch
32.503 kB
9.732 kB
react-table
DataGrid
150.617 kB
41.075 kB
react-table
Table (Primitives only)
47.03 kB
12.784 kB
react-table
Table as DataGrid
133.181 kB
33.644 kB
react-table
Table (Selection only)
81.092 kB
19.641 kB
react-table
Table (Sort only)
80.422 kB
19.453 kB
react-text
Text - Default
15.08 kB
5.353 kB
react-text
Text - Wrappers
15.63 kB
5.25 kB
react-textarea
Textarea
30.235 kB
9.521 kB
react-theme
Single theme token import
69 B
89 B
react-theme
Teams: all themes
31.33 kB
6.764 kB
react-theme
Teams: Light theme
17.895 kB
5.162 kB
react-tooltip
Tooltip
49.492 kB
16.862 kB
react-utilities
SSRProvider
180 B
159 B
🤖 This report was generated against 51767fd6bcd9fedcfe6e4b4735fdf13a1f1174bb

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 24, 2023

🕵 FluentUI-v0 No visual regressions between this PR and main

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 24, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 24, 2023

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 811 800 5000
Breadcrumb mount 2228 2236 1000
Checkbox mount 2160 2166 5000
CheckboxBase mount 1924 1915 5000
ChoiceGroup mount 3746 3759 5000
ComboBox mount 904 886 1000
CommandBar mount 8027 8067 1000
ContextualMenu mount 15518 15775 1000
DefaultButton mount 978 977 5000
DetailsRow mount 2954 2929 5000
DetailsRowFast mount 2963 2908 5000
DetailsRowNoStyles mount 2708 2688 5000
Dialog mount 3470 3453 1000
DocumentCardTitle mount 303 322 1000
Dropdown mount 2560 2538 5000
FocusTrapZone mount 1478 1553 5000
FocusZone mount 1442 1469 5000
GroupedList mount 50495 58842 2
GroupedList virtual-rerender 24319 24354 2
GroupedList virtual-rerender-with-unmount 74669 74968 2
GroupedListV2 mount 314 325 2
GroupedListV2 virtual-rerender 301 302 2
GroupedListV2 virtual-rerender-with-unmount 319 338 2
IconButton mount 1414 1420 5000
Label mount 451 462 5000
Layer mount 3675 3614 5000
Link mount 540 531 5000
MenuButton mount 1250 1217 5000
MessageBar mount 27810 27853 5000
Nav mount 2562 2549 1000
OverflowSet mount 1023 1025 5000
Panel mount 2232 2250 1000
Persona mount 975 975 1000
Pivot mount 1171 1184 1000
PrimaryButton mount 1092 1100 5000
Rating mount 5825 5827 5000
SearchBox mount 1150 1155 5000
Shimmer mount 2348 2382 5000
Slider mount 1728 1715 5000
SpinButton mount 3711 3772 5000
Spinner mount 523 529 5000
SplitButton mount 2438 2470 5000
Stack mount 543 553 5000
StackWithIntrinsicChildren mount 1141 1131 5000
StackWithTextChildren mount 3208 3216 5000
SwatchColorPicker mount 8136 8187 5000
TagPicker mount 1987 2002 5000
Text mount 496 503 5000
TextField mount 1200 1199 5000
ThemeProvider mount 1135 1133 5000
ThemeProvider virtual-rerender 786 773 5000
ThemeProvider virtual-rerender-with-unmount 1746 1742 5000
Toggle mount 831 807 5000
buttonNative mount 290 283 5000

@Hotell Hotell changed the title test: use isolatedModules for all ts-jest configs to lower memory footprint on CI test: use isolatedModules for all ts-jest configs to lower memory footprint on CI Apr 24, 2023
@Hotell Hotell marked this pull request as ready for review April 25, 2023 09:34
@Hotell Hotell requested a review from a team as a code owner April 25, 2023 09:34
@Hotell Hotell mentioned this pull request Apr 25, 2023
9 tasks
@tudorpopams tudorpopams self-requested a review April 25, 2023 12:14
@Hotell Hotell merged commit fc13ed7 into microsoft:master Apr 26, 2023
@Hotell Hotell deleted the hotell/build/faster-ci/jest-config-memory-improvements branch April 26, 2023 12:29
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Apr 27, 2023
* master:
  chore: enforce files naming to use .styles.ts [cxe-prg files] (microsoft#27707)
  chore: migrate to NodeJS v16 (microsoft#27711)
  remove react-avatar-context package (microsoft#27709)
  test: migrate all v9 libraries to use new conformance setup which improves test execution by approx 46% (microsoft#27669)
  chore: Add caret to react-datepicker-compat dependencies (microsoft#27671)
  test(fluentui/react): fix initial global leaks that were causing OOM issues (microsoft#27661)
  chore(react-utilities): simplifies useControllableState hook internals (microsoft#27702)
  chore: enforce files naming to use .styles.ts (microsoft#27698)
  feat: adds lazy loading example (microsoft#27587)
  feat: react-combobox space conditionally inserts character when freeform is true (microsoft#27025)
  chore(react-tree): updates useOpenItemsState internals (microsoft#27697)
  feat(tools): add conformance setup migration to migrate-converged-pkg generator (microsoft#27668)
  test: use `isolatedModules` for all ts-jest configs to lower memory footprint on CI (microsoft#27670)
  chore: bump @griffel/eslint-plugin & enable @griffel/hook-naming (microsoft#27687)
  feat(react-tree): makes useFlatTree generic (microsoft#27682)
  Enable export to codepen for charting library (microsoft#27539)
  Overflow: added useOverflowCount to exports (microsoft#27678)
  fix: Menu should not steal focus on re-render (microsoft#27688)
  feat(react-conformance): add new TS config api to be able to specify configName and configDir (microsoft#27664)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants